package com.edfu.core.identitymgt.persistence.entity;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.edfu.core.identitymgt.persistence.entity.UserEntity;

@Entity
@Table(name="cohort_user")
public class CohortUserRelnEntity implements IIdentityMgtEntity {
	private long id;
	private CohortEntity cohort;
	private UserEntity user;
	private String context;
	
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	
	@ManyToOne
	@JoinColumn(name = "cohort_id", nullable = false)
	public CohortEntity getCohort() {
		return cohort;
	}
	public void setCohort(CohortEntity cohort) {
		this.cohort = cohort;
	}
	
	@ManyToOne
	@JoinColumn(name = "user_id", nullable = false)
	public UserEntity getUser() {
		return user;
	}
	public void setUser(UserEntity user) {
		this.user = user;
	}
	public String getContext() {
		return context;
	}
	public void setContext(String context) {
		this.context = context;
	}
}
